<template>
    <div><br><br>
        <Navbar title="新闻详情"></Navbar>
        <h2>文章标题:{{details.title}}</h2>
        <h4>作者名称:{{details.author}}</h4>
        <p>文章内容:{{details.content}}</p>
        <img :src="details.img" />
        <h4>创建时间:{{details.gmtCreate}} &nbsp;观看次数:{{details.watchNum}}</h4>
        <Comment type="1"></Comment>   
    </div>
</template>
<script>
    export default{
        name:"newsDetail",
        data(){
            return{
                details:{}
            }
        },
        created(){
            let id = this.$route.query.id
            console.log(id)
            this.$axios.get("selectArticleInfoById?id="+id)
            .then(res=>{
                console.log(res.data)
                this.details = res.data
            }).catch(err=>{
                console.log(err)
            })
        }
    }
</script>
<style>
    img{
        width: 100%;
        text-align: center;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
</style>